//
//  QLPublic.h
//  QLSchool_IOS
//
//  Created by anan on 14-1-10.
//  Copyright (c) 2014年 baobaodev_anan. All rights reserved.
//

#import <Foundation/Foundation.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <net/if_dl.h>

typedef void(^QLHttpResultBlock)(BOOL isCache,id data);

#define STR_MSG_NETWORK_ERROR @"网络连接失败!"

#define DEFAULT_PAGESIZE 18

#define QLIntToNumber(value)     [NSNumber numberWithInt:value]
#define QLLongToNumber(value)    [NSNumber numberWithLong:value]
#define QLFloatToNumber(value)   [NSNumber numberWithFloat:value]
#define QLDoubleToNumber(value)   [NSNumber numberWithDouble:value]
#define QLBoolToNumber(value)    [NSNumber numberWithBool:value]

#define QLIntToString(value,format)  format == nil ? [NSString stringWithFormat:@"%i",value] : [NSString stringWithFormat:format,value]
#define QLLongToString(value,format) format == nil ? [NSString stringWithFormat:@"%lu",value] : [NSString stringWithFormat:format,value]
#define QLFloatToString(value,format) format == nil ? [NSString stringWithFormat:@"%f",value] : [NSString stringWithFormat:format,value]

@interface QLPublic : NSObject<UIAlertViewDelegate>

+ (NSString *)addParam2UrlStr:(NSString*)url key:(NSString*)key value:(NSString*)value;

+ (NSString *)addParam2ImageUrlStr:(NSString*)url w:(int)w h:(int)h m:(int)m;

+ (NSString *)addParam2ImageUrlStr:(NSString*)url w:(int)w h:(int)h;

+ (NSString *)addParam2ImageUrlStr:(NSString*)url w:(int)w;

+ (NSString *)getVersionString;

+ (int)getVersion;

//判断是否安装微信
+ (BOOL)isWXAppInstalled;

+ (UIViewController *)getCurrentRootViewController;

+ (void)setScrollsToTopWithContentView:(UIView*)contentView enable:(BOOL)enable;

+ (NSString *) macaddress;

+ (BOOL)isSuccess:(NSDictionary*)dic;

+ (BOOL)isAdminAccount;
@end
